package com.ruoyi.cost.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cost.mapper.MedicalCostRegisterMapper;
import com.ruoyi.cost.domain.MedicalCostRegister;
import com.ruoyi.cost.service.IMedicalCostRegisterService;

/**
 * 挂号费用Service业务层处理
 * 
 * @author Atong
 * @date 2022-01-03
 */
@Service
public class MedicalCostRegisterServiceImpl implements IMedicalCostRegisterService 
{
    @Autowired
    private MedicalCostRegisterMapper medicalCostRegisterMapper;

    /**
     * 查询挂号费用
     * 
     * @param id 挂号费用主键
     * @return 挂号费用
     */
    @Override
    public MedicalCostRegister selectMedicalCostRegisterById(Long id)
    {
        return medicalCostRegisterMapper.selectMedicalCostRegisterById(id);
    }

    /**
     * 查询挂号费用列表
     * 
     * @param medicalCostRegister 挂号费用
     * @return 挂号费用
     */
    @Override
    public List<MedicalCostRegister> selectMedicalCostRegisterList(MedicalCostRegister medicalCostRegister)
    {
        return medicalCostRegisterMapper.selectMedicalCostRegisterList(medicalCostRegister);
    }

    /**
     * 新增挂号费用
     * 
     * @param medicalCostRegister 挂号费用
     * @return 结果
     */
    @Override
    public int insertMedicalCostRegister(MedicalCostRegister medicalCostRegister)
    {
        //new Date().getTime()
        medicalCostRegister.setId(new Date().getTime());
        medicalCostRegister.setCreateTime(DateUtils.getNowDate());
        return medicalCostRegisterMapper.insertMedicalCostRegister(medicalCostRegister);
    }

    /**
     * 修改挂号费用
     * 
     * @param medicalCostRegister 挂号费用
     * @return 结果
     */
    @Override
    public int updateMedicalCostRegister(MedicalCostRegister medicalCostRegister)
    {
        return medicalCostRegisterMapper.updateMedicalCostRegister(medicalCostRegister);
    }

    /**
     * 批量删除挂号费用
     * 
     * @param ids 需要删除的挂号费用主键
     * @return 结果
     */
    @Override
    public int deleteMedicalCostRegisterByIds(Long[] ids)
    {
        return medicalCostRegisterMapper.deleteMedicalCostRegisterByIds(ids);
    }

    /**
     * 删除挂号费用信息
     * 
     * @param id 挂号费用主键
     * @return 结果
     */
    @Override
    public int deleteMedicalCostRegisterById(Long id)
    {
        return medicalCostRegisterMapper.deleteMedicalCostRegisterById(id);
    }
}
